/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86184
 * Date: 2023-02-18
 * Time: 8:56
 */
interface ISwimming{
    public abstract void swimming();
}
interface IRunning{
    public abstract void running();
}

interface IFlying{
    public abstract void flying();
}

class Animal3{
    public String name;
    public int age;

    public Animal3(String name,int age){
        this.name=name;
        this.age=age;
    }

    public void eat(){
        System.out.println("吃饭");
    }
}

class Dog2 extends Animal3 implements IRunning,ISwimming{
    @Override
    public void swimming() {
        System.out.println(name+"正在狗爬式有用");
    }

    @Override
    public void running() {
        System.out.println(name+"正在跑");
    }

    public Dog2(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat() {
        System.out.println(name+"长在吃狗粮");
    }
}

class Duck extends Animal3 implements IRunning,ISwimming,IFlying{
    @Override
    public void swimming() {
        System.out.println(name+"正在划水");
    }

    @Override
    public void running() {
        System.out.println(name+"正在跑步");
    }

    @Override
    public void flying() {
        System.out.println(name+"正在飞");
    }

    public Duck(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat() {
        System.out.println(name+"正在吃鸭粮");
    }
}


public class Interface1 {

    public static void eat(Animal3 animal3){
        animal3.eat();
    }
    public static void running(IRunning running){
        running.running();
    }
    public static void main(String[] args) {
        eat(new Dog2("旺财",10));
        eat(new Duck("小七",20));
        System.out.println("=================");
        running(new Dog2("旺财",10));
        running(new Duck("小七",20));
    }
}
